package com.net.xpay.partner.controller.partner;

import com.net.common.model.ResultPagedList;
import com.net.xpay.common.domain.partner.Partner;
import com.net.xpay.common.domain.partner.PartnerSafePaySettleRecord;
import com.net.xpay.common.manager.partner.PartnerSafePaySettleRecordManager;
import com.net.xpay.common.model.search.PartnerSafePaySettleRecordSearchModel;
import com.net.xpay.partner.secutiry.RequestUser;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

/**
 *

 * 合伙人安全付每日统计记录
 */
@RestController
@RequestMapping("/partner/partner-safe-pay-settle-record")
@Api(tags = "运营/合伙人每日统计记录", description = "运营 合伙人安全付每日统计记录 net")
public class SafePaySettleRecordController {

    @Autowired
    private PartnerSafePaySettleRecordManager partnerSafePaySettleRecordManager;

    @ApiOperation("搜索合伙人每日统计记录")
    @PostMapping("/search")
    @ResponseBody
    public ResultPagedList<PartnerSafePaySettleRecord> searchPartnerSafePaySettleRecord(@ApiIgnore @RequestUser Partner partner, @RequestBody PartnerSafePaySettleRecordSearchModel searchModel) {
        searchModel.setPartnerId(partner.getId());
        List<PartnerSafePaySettleRecord> records = partnerSafePaySettleRecordManager.search(searchModel);
        long count = partnerSafePaySettleRecordManager.searchCount(searchModel);
        return new ResultPagedList<>(records, count, searchModel);
    }
}
